// 全局怪物等级管理器
class LevelManager {
    private static instance: LevelManager;
    private level: number = 1;

    private constructor() { }

    public static getInstance(): LevelManager {
        if (!LevelManager.instance) {
            LevelManager.instance = new LevelManager();
        }
        return LevelManager.instance;
        
    }

    //成功后提升一关
    public increaseLevel(): void {
        this.level++;
    }

    //死亡后返回三关
    public backLevel(): void {
        this.level -= 3;
        if (this.level < 1) {
            this.level = 1;
        }

    }

    public getLevel(): number {
        return this.level;
    }
}
export default LevelManager;